package com.chengjue.rocketmq.manager;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.client.producer.DefaultMQProducer;
import org.apache.rocketmq.common.message.Message;
import org.apache.rocketmq.remoting.exception.RemotingException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: Kipeng Huang
 * @Date: 2018-4-12 15:25
 */
@Component
public class RocketMQClient {
    @Autowired
    private DefaultMQProducer mqProducer;
    public void sendMessage(Message message) throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
        mqProducer.send(message);
    }

}
